package lean;
import java.util.Arrays;
import java.util.Scanner;
public class yu {
    public static void main(String[] args){
        Scanner scanner =new Scanner(System.in);
        int num[]=new int[5];
                for(int i=0;i<num.length;i++){
                    System.out.println("请输入五名学生的的成绩:");
                    int num1=scanner.nextInt();
                    num[i]=num1;
                }
                System.out.println("这是刚录入的成绩未排序:"+Arrays.toString(num));
                for(int i=0;i<num.length-1;i++){
                    int temp=0;
                    for(int j=1;j<num.length-i;j++){
                        if(num[j]>num[j-1]){
                            temp=num[j-1];
                            num[j-1]=num[j];
                            num[j]=temp;
                        }
                    }
                    System.out.println("第"+(i+1)+"轮比较的结果"+Arrays.toString(num));
                }
                System.out.println("");
                System.out.println("学生成绩按降序排列:"+Arrays.toString(num));
    }
}
